Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geeksevent #41

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Geeksevent #41

wants to merge 9 commits into from

Conversation

razan99
Copy link

@razan99 razan99 commented Jun 27, 2018

No description provided.


const controllers = require('./controllers');
const bodyParser = require('body-parser');
const dbConnection = require('./database/db_connect')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you requiring dbconnection in your app?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

becuese i have a problem to save data i enter in the form in data base
its necessary to require dbconnection app

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not. You shouldn't require your dbConnection in your app.

const Events = require('../database/events');

exports.get = (req, res, next) => {
res.render('event', {event: true, script: 'event_dom.js', title: 'My page' });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the event: true?


exports.post = (req, res, next) => {

const schema = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate the queries from the controllers

@@ -0,0 +1,3 @@
const Events = require('../events')

module.exports = (object) => new Events({ object }).save();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good, you've created a query, and used it where?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

event.js in controller

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No you haven't required it in event.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants